package com.chinasofti.collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Demo02 {
    public static void main(String[] args) {

        Collection<String> c = new ArrayList<>();
        //添加元素
        c.add("aaa");
        c.add("bbb");
        c.add("ccc");
        c.add("ddd");
        Iterator<String> it = c.iterator();
        while(it.hasNext()){
            String s = it.next();
            System.out.println("s = " + s);
        }

    }
}
